<template>
  <div class='search'>
    <a-descriptions bordered size='small' :column='3'>
      <a-descriptions-item label='单据日期'>
        {{ formItem.orderDate }}
      </a-descriptions-item>
      <a-descriptions-item label='订单编号'>
        {{ formItem.orderNo }}
      </a-descriptions-item>
      <a-descriptions-item label='单位编码'>
        {{ formItem.companyCode }}
      </a-descriptions-item>
      <a-descriptions-item label='业务员'>
        {{ formItem.employeeName }}
      </a-descriptions-item>
      <a-descriptions-item label='区域'>
        {{ formItem.deptName }}
      </a-descriptions-item>
    </a-descriptions>
    <a-divider orientation='left'>订单商品</a-divider>
    <a-table :columns='orderDetailsColumns' size='small' :data-source='orderDetailsList' :bordered='true' :pagination='false'>


    </a-table>
  </div>
</template>
<script>
import api from "./js/api"

export default {
  name: "orderInfo",
  props: {},
  data() {
    return {
      refs: this.$refs,
      loadDept: false,
      queryParam: { orderId: "" },
      api: Object.assign(api, this.api),
      isAdd: true,//是否是添加模式
      loaded: false,//是否加载完成
      orderDetailsId: null,
      processImageVisible: false,
      orderDetailsColumns: [
        {
          title: "商品名称",
          align: "center",
          width: "190px",
          dataIndex: "productName"
        },  {
          title: "生产企业",
          align: "center",
          width: "190px",
          dataIndex: "producersName"
        },{
          title: "批号",
          align: "center",
          dataIndex: "BatchNumber"
        }, {
          title: "商品规格",
          align: "center",
          width: "190px",
          dataIndex: "specifications"
        }, {
          title: "件容",
          align: "center",
          dataIndex: "capacityNum"
        }, {
          title: "数量",
          align: "center",
          dataIndex: "saleNum"
        },{
          title: "含税价格",
          align: "center",
          dataIndex: "salePrice"
        },{
          title: "销售金额",
          align: "center",
          dataIndex: "taxAmount"
        }, {
          title: "无税价格",
          align: "center",
          dataIndex: "noTaxPrice"
        }, {
          title: "无税金额",
          align: "center",
          dataIndex: "noTaxAmount"
        },{
          title: "销售价格",
          align: "center",
          dataIndex: "salePrice"
        }, {
          title: "销售金额",
          align: "center",
          dataIndex: "saleAmount"
        }
      ],
      formItem: this.getFormItem(),
      supplierBond: {},
      orderDetailsList: []
    }
  },
  methods: {
    getFormItem() {
      return {
        orderNo: ""
      }
    },
    getOrderDetailList(orderNo) {
      let params = { "orderNo": orderNo }
      this.http.get(this, {
        url: this.api.hyOrderDetail.queryHyOrderDetailList,
        params: params,
        success: function(me, data) {
          console.info(data)
          me.orderDetailsList = data
        }
      })
    },
    //表单赋值
    setData(record) {
      console.info(record)
      this.formItem = this.getFormItem()
      if (record && record.orderNo) {
        let params = {
          orderNo: record.orderNo
        }
        this.http.get(this, {
          url: this.api.hyOrder.get,
          params: params,
          success: function(me, data) {
            console.info(data)
            me.formItem = data
            me.loaded = true
          }
        })
        this.getOrderDetailList(record.orderNo)
      }
    }
  },
  mounted() {
  },
  created() {
  },
  components: {}
}
</script>

<style scoped lang='less' rel='stylesheet/less'>

</style>
